﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Civic.Platform.Teach.Model.Common
{
    public class MessageModel<T>
    {
        public int status { get; set; } = 200;


        public bool success { get; set; }

        public string msg { get; set; } = "";


        public string msgDev { get; set; }

        public T response { get; set; }

        public static MessageModel<T> Success(string msg)
        {
            return Message(success: true, msg, default);
        }

        public static MessageModel<T> Success(string msg, T response)
        {
            return Message(success: true, msg, response);
        }

        public static MessageModel<T> Fail(string msg)
        {
            return Message(success: false, msg, default);
        }

        public static MessageModel<T> Fail(string msg, T response)
        {
            return Message(success: false, msg, response);
        }

        public static MessageModel<T> Message(bool success, string msg, T response)
        {
            return new MessageModel<T>
            {
                msg = msg,
                response = response,
                success = success
            };
        }
    }
    public class MessageModel
    {
        public int status { get; set; } = 200;


        public bool success { get; set; }

        public string msg { get; set; } = "";


        public object response { get; set; }
    }
}
